/**
 * This Enum wraps up a Game Difficulty.
 * 
 * @author (Dilyan GEORGIEV)
 * @author (Thomas KOBER)
 * @author (Matthew MCDONALD)
 * 
 * @version (1.0)
 */
public enum Difficulty  
{
    /**
     * Difficulty Easy.
     */
    EASY(0),
    
    /**
     * Difficulty Medium.
     */
    MEDIUM(1),
    
    /**
     * Difficulty Hard.
     */
    HARD(2),
    
    /**
     * Empty Difficulty.
     */
    FAIL(666);
    
    private int value;
    
    Difficulty(int value)
    {
        this.value = value;
    }
    
    /**
     * Returns the value associated with the Difficulty.
     * @return the value associated with the Difficulty.
     */
    public int getValue()
    {
        return this.value;
    }
    
    /**
     * Returns the Difficulty for the given value.
     * @param the value for which to get the Difficulty.
     * @return the Difficulty for the given value.
     */
    public static Difficulty difficultyForValue(int value)
    {
        Difficulty d = FAIL;
        
        switch (value) {
        
            case 0: 
                d = EASY;
                break;
                
            case 1:
                d = MEDIUM;
                break;
                
            case 2:
                d = HARD;
                break;
            
            default:
                d = FAIL;
                break;
        }
        
        return d;
    }
}
